home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
- Begin VB.Form frmMain
- BackColor = &H8000000A&
- Caption = "Icon32 - Untitled"
- ClientHeight = 6480
- ClientLeft = 60
- ClientTop = 630
- ClientWidth = 8190
- Icon = "icon32.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 6480
- ScaleWidth = 8190
- Begin VB.CommandButton cmdFont
- Caption = "MS Sans Serif"
- Height = 375
- Left = 5640
- TabIndex = 87
- Top = 600
- Width = 2295
- End
- Begin ComctlLib.StatusBar SBar
- Align = 2 'Align Bottom
- Height = 255
- Left = 0
- TabIndex = 77
- Top = 6225
- Width = 8190
- _ExtentX = 14446
- _ExtentY = 450
- SimpleText = ""
- _Version = 327682
- BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7}
- NumPanels = 1
- BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7}
- Object.Tag = ""
- EndProperty
- EndProperty
- End
- Begin VB.Frame Frame3
- Caption = "Shift Image"
- Height = 2055
- Left = 6000
- TabIndex = 68
- ToolTipText = "Shifts Entire Image"
- Top = 3840
- Width = 2100
- Begin VB.CommandButton cmdShift
- Caption = "&R"
- Height = 495
- Index = 0
- Left = 1440
- TabIndex = 76
- Top = 840
- Width = 495
- End
- Begin VB.CommandButton cmdShift
- Caption = "&L"
- Height = 495
- Index = 1
- Left = 240
- TabIndex = 75
- Top = 840
- Width = 495
- End
- Begin VB.CommandButton cmdShift
- Caption = "&U"
- Height = 495
- Index = 2
- Left = 840
- TabIndex = 74
- Top = 240
- Width = 495
- End
- Begin VB.CommandButton cmdShift
- Caption = "&D"
- Height = 495
- Index = 3
- Left = 840
- TabIndex = 73
- Top = 1440
- Width = 495
- End
- Begin VB.CommandButton cmdShift
- Caption = "UL"
- Height = 495
- Index = 4
- Left = 240
- TabIndex = 72
- Top = 240
- Width = 495
- End
- Begin VB.CommandButton cmdShift
- Caption = "UR"
- Height = 495
- Index = 5
- Left = 1440
- TabIndex = 71
- Top = 240
- Width = 495
- End
- Begin VB.CommandButton cmdShift
- Caption = "DL"
- Height = 495
- Index = 6
- Left = 240
- TabIndex = 70
- Top = 1440
- Width = 495
- End
- Begin VB.CommandButton cmdShift
- Caption = "DR"
- Height = 495
- Index = 7
- Left = 1440
- TabIndex = 69
- Top = 1440
- Width = 495
- End
- End
- Begin VB.Frame Frame2
- Caption = "Mode"
- Height = 975
- Left = 0
- TabIndex = 66
- Top = 120
- Width = 855
- Begin VB.PictureBox picMode
- Appearance = 0 'Flat
- AutoRedraw = -1 'True
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 540
- Left = 150
- ScaleHeight = 34
- ScaleMode = 0 'User
- ScaleWidth = 34
- TabIndex = 67
- ToolTipText = "Displays Selected Mode"
- Top = 240
- Width = 540
- End
- End
- Begin VB.Frame Frame1
- Caption = "Mode Select"
- Height = 975
- Left = 960
- TabIndex = 65
- Top = 120
- Width = 4575
- Begin VB.PictureBox picModeSel
- Height = 540
- Index = 8
- Left = 3960
- Picture = "icon32.frx":030A
- ScaleHeight = 480
- ScaleWidth = 480
- TabIndex = 86
- ToolTipText = "Capture (Select Region) Mode"
- Top = 240
- Width = 540
- End
- Begin VB.PictureBox picModeSel
- Height = 540
- Index = 7
- Left = 3480
- Picture = "icon32.frx":0614
- ScaleHeight = 480
- ScaleWidth = 480
- TabIndex = 85
- ToolTipText = "Color Fill Mode"
- Top = 240
- Width = 540
- End
- Begin VB.PictureBox picModeSel
- Height = 540
- Index = 6
- Left = 3000
- Picture = "icon32.frx":091E
- ScaleHeight = 480
- ScaleWidth = 480
- TabIndex = 84
- ToolTipText = "Text Mode"
- Top = 240
- Width = 540
- End
- Begin VB.PictureBox picModeSel
- Height = 540
- Index = 5
- Left = 2520
- Picture = "icon32.frx":0C28
- ScaleHeight = 480
- ScaleWidth = 480
- TabIndex = 83
- ToolTipText = "Filled Circle Mode"
- Top = 240
- Width = 540
- End
- Begin VB.PictureBox picModeSel
- Height = 540
- Index = 4
- Left = 2040
- Picture = "icon32.frx":0F32
- ScaleHeight = 480
- ScaleWidth = 480
- TabIndex = 82
- ToolTipText = "Circle Mode"
- Top = 240
- Width = 540
- End
- Begin VB.PictureBox picModeSel
- Height = 540
- Index = 3
- Left = 1560
- Picture = "icon32.frx":123C
- ScaleHeight = 480
- ScaleWidth = 480
- TabIndex = 81
- ToolTipText = "Filled Rectangle Mode"
- Top = 240
- Width = 540
- End
- Begin VB.PictureBox picModeSel
- Height = 540
- Index = 2
- Left = 1080
- Picture = "icon32.frx":1546
- ScaleHeight = 480
- ScaleWidth = 480
- TabIndex = 80
- ToolTipText = "Rectangle Mode"
- Top = 240
- Width = 540
- End
- Begin VB.PictureBox picModeSel
- Height = 540
- Index = 1
- Left = 600
- Picture = "icon32.frx":1850
- ScaleHeight = 480
- ScaleWidth = 480
- TabIndex = 79
- ToolTipText = "Line Mode"
- Top = 240
- Width = 540
- End
- Begin VB.PictureBox picModeSel
- Height = 540
- Index = 0
- Left = 120
- Picture = "icon32.frx":1B5A
- ScaleHeight = 480
- ScaleWidth = 480
- TabIndex = 78
- ToolTipText = "Pencil Mode (mouse with any shift key draws straight line)"
- Top = 240
- Width = 540
- End
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 47
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 64
- Top = 4080
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 46
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 63
- Top = 3840
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 45
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 62
- Top = 4320
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 44
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 61
- Top = 3840
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 43
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 60
- Top = 4080
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 42
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 59
- Top = 4320
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 41
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 58
- Top = 4080
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 40
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 57
- Top = 4320
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 39
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 56
- Top = 4320
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 38
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 55
- Top = 4080
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 37
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 54
- Top = 3840
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 36
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 53
- Top = 3840
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 35
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 52
- Top = 4560
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 34
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 51
- Top = 4560
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 33
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 50
- Top = 4560
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 32
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 49
- Top = 4560
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H0000C0C0&
- Height = 255
- Index = 31
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 48
- Top = 3240
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H000000C0&
- Height = 255
- Index = 30
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 47
- Top = 3480
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H000040C0&
- Height = 255
- Index = 29
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 46
- Top = 3480
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00004080&
- Height = 255
- Index = 28
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 315
- TabIndex = 45
- Top = 3240
- Width = 375
- End
- Begin VB.PictureBox Color
- BackColor = &H00C0E0FF&
- Height = 255
- Index = 27
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 44
- Top = 2760
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFC0C0&
- Height = 255
- Index = 26
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 43
- Top = 3000
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00C00000&
- Height = 255
- Index = 25
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 42
- Top = 3480
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00000080&
- Height = 255
- Index = 24
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 41
- Top = 3240
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00800000&
- Height = 255
- Index = 23
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 40
- Top = 3480
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00C0C0FF&
- Height = 255
- Index = 22
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 39
- Top = 2760
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00C0FFFF&
- Height = 255
- Index = 21
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 38
- Top = 2760
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00C0FFC0&
- Height = 255
- Index = 20
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 37
- Top = 2760
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H008080FF&
- Height = 255
- Index = 19
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 36
- Top = 3000
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H0080C0FF&
- Height = 255
- Index = 18
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 35
- Top = 3000
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H0080FFFF&
- Height = 255
- Index = 17
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 34
- Top = 3000
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H0000C000&
- Height = 255
- Index = 16
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 33
- Top = 3240
- Width = 255
- End
- Begin VB.CommandButton cmdFlipV
- Caption = "Flip V"
- Height = 375
- Left = 6960
- TabIndex = 31
- ToolTipText = "Flip Vertically"
- Top = 3000
- Width = 855
- End
- Begin VB.CommandButton cmdFlipH
- Caption = "Flip H"
- Height = 375
- Left = 6000
- TabIndex = 30
- ToolTipText = "Flips Horizontally"
- Top = 3000
- Width = 855
- End
- Begin VB.CommandButton cmdRotate
- Caption = "Rotate"
- Height = 375
- Left = 6000
- TabIndex = 29
- ToolTipText = "Rotate Image"
- Top = 2400
- Width = 855
- End
- Begin VB.PictureBox picCap
- AutoRedraw = -1 'True
- BackColor = &H80000009&
- Height = 540
- Left = 4920
- ScaleHeight = 32
- ScaleMode = 3 'Pixel
- ScaleWidth = 32
- TabIndex = 27
- Top = 5400
- Width = 540
- End
- Begin VB.CommandButton cmdPaste
- Enabled = 0 'False
- Height = 375
- Left = 6960
- Picture = "icon32.frx":1E64
- Style = 1 'Graphical
- TabIndex = 26
- ToolTipText = "Pastes Clipboard to Mouseclick Position"
- Top = 2400
- Width = 855
- End
- Begin VB.CommandButton cmdCopy
- Enabled = 0 'False
- Height = 375
- Left = 6960
- Picture = "icon32.frx":2396
- Style = 1 'Graphical
- TabIndex = 25
- ToolTipText = "Copies Selected Area to Clipboard"
- Top = 1800
- Width = 855
- End
- Begin VB.CommandButton cmdCut
- Enabled = 0 'False
- Height = 375
- Left = 6960
- Picture = "icon32.frx":28C8
- Style = 1 'Graphical
- TabIndex = 24
- ToolTipText = "Cuts selected area and copies to clipboard"
- Top = 1200
- Width = 855
- End
- Begin VB.CommandButton cmdGrid
- Caption = "&Grid"
- Height = 375
- Left = 6000
- TabIndex = 23
- ToolTipText = "Toggles Grid"
- Top = 1800
- Width = 855
- End
- Begin VB.TextBox txtAlpha
- Height = 285
- Left = 6120
- TabIndex = 22
- Top = 240
- Width = 1455
- End
- Begin VB.CommandButton cmdClear
- Caption = "&Clear"
- Height = 375
- Left = 6000
- TabIndex = 20
- ToolTipText = "Clear to Left or Right Color"
- Top = 1200
- Width = 855
- End
- Begin MSComDlg.CommonDialog cd
- Left = 4320
- Top = 5880
- _ExtentX = 847
- _ExtentY = 847
- _Version = 327681
- End
- Begin VB.PictureBox Ikon
- AutoRedraw = -1 'True
- BackColor = &H80000009&
- Height = 540
- Left = 4920
- ScaleHeight = 32
- ScaleMode = 3 'Pixel
- ScaleWidth = 32
- TabIndex = 19
- Top = 4920
- Width = 540
- End
- Begin VB.PictureBox Color
- BackColor = &H00FF80FF&
- Height = 255
- Index = 15
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 18
- Top = 2400
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FF8080&
- Height = 255
- Index = 14
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 17
- Top = 2400
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFF80&
- Height = 255
- Index = 13
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 16
- Top = 2400
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H0080FF80&
- Height = 255
- Index = 12
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 15
- Top = 2400
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H0080FFFF&
- Height = 255
- Index = 11
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 14
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H0080C0FF&
- Height = 255
- Index = 10
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 13
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H008080FF&
- Height = 255
- Index = 9
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 12
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00E0E0E0&
- Height = 255
- Index = 8
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 11
- Top = 2160
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFC0C0&
- Height = 255
- Index = 7
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 10
- Top = 1920
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFC0FF&
- Height = 255
- Index = 6
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 9
- Top = 1920
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFC0&
- Height = 255
- Index = 5
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 8
- Top = 1920
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00C0FFC0&
- Height = 255
- Index = 4
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 7
- Top = 1920
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00C0FFFF&
- Height = 255
- Index = 3
- Left = 5640
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 6
- Top = 1680
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00C0E0FF&
- Height = 255
- Index = 2
- Left = 5400
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 5
- Top = 1680
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00C0C0FF&
- Height = 255
- Index = 1
- Left = 5160
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 4
- Top = 1680
- Width = 255
- End
- Begin VB.PictureBox Color
- BackColor = &H00FFFFFF&
- Height = 255
- Index = 0
- Left = 4920
- ScaleHeight = 195
- ScaleWidth = 195
- TabIndex = 3
- Top = 1680
- Width = 255
- End
- Begin VB.PictureBox RightColor
- BackColor = &H80000009&
- Height = 495
- Left = 5400
- ScaleHeight = 435
- ScaleWidth = 435
- TabIndex = 2
- ToolTipText = "Right Button Color"
- Top = 1200
- Width = 495
- End
- Begin VB.PictureBox LeftColor
- BackColor = &H80000007&
- Height = 495
- Left = 4920
- ScaleHeight = 435
- ScaleWidth = 435
- TabIndex = 1
- ToolTipText = "Left Button Color"
- Top = 1200
- Width = 495
- End
- Begin VB.PictureBox grid
- Appearance = 0 'Flat
- AutoRedraw = -1 'True
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 4832
- Left = 0
- ScaleHeight = 4800
- ScaleWidth = 4800
- TabIndex = 0
- Top = 1200
- Width = 4832
- Begin VB.Shape shCapture
- BorderColor = &H00FF0000&
- BorderStyle = 4 'Dash-Dot
- Height = 495
- Left = 2160
- Top = 1560
- Visible = 0 'False
- Width = 375
- End
- Begin VB.Shape shRect
- Height = 15
- Left = 0
- Top = 0
- Visible = 0 'False
- Width = 15
- End
- Begin VB.Line shLine
- Visible = 0 'False
- X1 = 0
- X2 = 0
- Y1 = 0
- Y2 = 0
- End
- Begin VB.Shape shCircle
- Height = 15
- Left = 1320
- Shape = 3 'Circle
- Top = 1800
- Visible = 0 'False
- Width = 15
- End
- End
- Begin VB.Label Label5
- Caption = "Text:"
- Height = 255
- Left = 5640
- TabIndex = 32
- Top = 285
- Width = 735
- End
- Begin VB.Label Label4
- Caption = "Clip"
- Height = 255
- Left = 5520
- TabIndex = 28
- Top = 5520
- Width = 495
- End
- Begin VB.Label Label1
- Caption = "Icon"
- Height = 255
- Left = 5520
- TabIndex = 21
- Top = 5040
- Width = 615
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileOpen
- Caption = "&Open"
- End
- Begin VB.Menu mnuFileSave
- Caption = "&Save"
- End
- Begin VB.Menu mnuFileExit
- Caption = "&Exit"
- End
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '***********************************************
- ' Many thanks to Burt Abreau and his fine
- ' website (www.vbexplorer.com) for pointing
- ' me in the right direction.
- '***********************************************
- ' Written in Visual Basic 5.0
- 'Hello fellow VB programmers. Like many projects,
- 'this grew out of a need for an icon designer that
- 'would do what I wanted it to do--vice what someone
- 'else had in mind. I had been working on another
- 'project which needed customized icons. I searched
- 'the net but couldn't find an icon editor that
- 'would do what I wanted, so I put the other project
- 'on hold while I wrote this. It started out bare
- 'bones, but you know how that goes.
- 'I didn't write a help file but here are some notes,
- 'not in any order:
- '(1) Note that a doubleclick on the last 16 color
- 'boxes will let you define your own color.
- '(2) The first 16 colors are solid colors and
- 'react to all modes normally. However, the 2nd
- 'group contains mixed colors & you will see the
- 'results if you draw a solid shape or clear to
- 'those colors.
- '(3) The Clear command button clears to the left
- 'color if left clicked & vice versa.
- '(4) I beat myself to death trying to get the
- 'ExtFloodFill API call to work until I finally
- 'figured out that you have to invoke
- ' Picture1.Picture = Picture1.Image
- '---whatever that does.
- '(5) I think ICONWRKS, which came with VB3 would do
- 'what I wanted, but in spite of my tweaking & converting
- 'to 32 bit, it 'illegal ops' on the GetBitMapBits call.
- 'Anyone know how to fix it?
- 'Do what you want with this source, however check it
- 'out carefully before you run it. I cannot know about
- 'every person's PC setup & will not be held liable
- 'if it locks up your machine and wipes out your drive.
- 'I sincerely doubt this will happen, but who knows?
- 'Questions/comments to me (Norm Cook):
- ' guinn@netjava.com
- 'Be happy in your programming
- Option Explicit
- Private Declare Function ExtFloodFill Lib "gdi32" _
- (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, _
- ByVal crColor As Long, ByVal wFillType As Long) As Long
- Const FLOODFILLSURFACE = 1
- Dim miStartX%, miStartY% 'define position at mousedown
- Dim miMoveX%, miMoveY% ' " " " mousemove
- Dim miCapX1%, miCapY1% 'define capture coordinates
- Dim miCapX2%, miCapY2%
- Dim miMode% 'mode
- Const PENCILMODE = 0
- Const LINEMODE = 1
- Const RECTMODE = 2
- Const RECTFILLMODE = 3
- Const CIRCMODE = 4
- Const CIRCFILLMODE = 5
- Const TEXTMODE = 6
- Const FLOODMODE = 7
- Const CAPTUREMODE = 8
- Const PASTEMODE = 9
- Private Sub Form_Load()
- Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
- Init
- picModeSel_Click 0 'set pencil mode
- cmdGrid_Click 'remove to start up without grid
- End Sub
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- 'clear out grid coordinates when mouse leaves grid
- SBar.Panels(3).Text = ""
- UpdateSBar
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Set frmMain = Nothing 'return memory to system
- End Sub
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- Unload Me
- End Sub
- Private Sub Init()
- Dim i%
- For i = 0 To 15
- Color(i).BackColor = QBColor(i)
- Next
- For i = 31 To 47
- Color(i).ToolTipText = "Doubleclick for custom colors"
- Next
- SBar.Panels.Add
- SBar.Panels.Add
- SBar.Panels(1).Width = Width * 0.7
- SBar.Panels(2).Width = Width * 0.1
- SBar.Panels(3).Width = Width * 0.2
- UpdateSBar
- End Sub
- Private Sub UpdateSBar()
- SBar.Panels(2).Text = Format$(Now, "short time")
- End Sub
- 'Used to plot a square on the main grid
- ' as well as the ikon
- Private Sub Plot(ByVal X%, ByVal Y%, ByVal c&)
- If cmdGrid.Caption = "&Grid" Then
- 'without grid=>larger box
- grid.Line (X, Y)-(X + 140, Y + 140), c, BF
- Else
- 'with grid=>smaller, so that grid lines visible
- grid.Line (X + 10, Y + 10)-(X + 130, Y + 130), c, BF
- End If
- Ikon.PSet (X \ 150, Y \ 150), c
- End Sub
- Private Sub Color_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
- 'color select
- If Button = 1 Then
- LeftColor.BackColor = Color(Index).BackColor
- Else
- RightColor.BackColor = Color(Index).BackColor
- End If
- End Sub
- Private Sub Color_DblClick(Index As Integer)
- If Index > 31 Then
- cd.ShowColor
- If Err <> 32755 Then
- Color(Index).BackColor = cd.Color
- End If
- End If
- End Sub
- 'These 3 routines, mousedown, mousemove & mouseup
- ' are the meat of the program
- Private Sub grid_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim c&
- miStartX = X: miStartY = Y
- 'get color for subsequent ops
- If Button = 1 Then c = LeftColor.BackColor Else c = RightColor.BackColor
- Select Case miMode
- Case PENCILMODE
- Plot 150 * miMoveX, 150 * miMoveY, c
- Case CIRCMODE, CIRCFILLMODE
- shCircle.Visible = True
- Case LINEMODE
- shLine.Visible = True
- Case RECTMODE, RECTFILLMODE
- shRect.Visible = True
- Case TEXTMODE
- Case CAPTUREMODE
- shCapture.Visible = True
- End Select
- End Sub
- Private Sub grid_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim strx$, stry$
- UpdateSBar
- grid.MousePointer = vbCrosshair
- miMoveX = X \ 150: miMoveY = Y \ 150
- 'build coordinates message for status bar
- strx = "X: " & Right$("0" & CStr(miMoveX), 2)
- stry = "Y: " & Right$("0" & CStr(miMoveY), 2)
- SBar.Panels(3).Text = strx & " " & stry
- If Button Then 'nothing else happens if mouse
- Dim c& ' not being dragged
- If Button = 1 Then 'left button
- c = LeftColor.BackColor
- Else
- c = RightColor.BackColor
- End If
- Select Case miMode
- Case PENCILMODE
- 'having pencilmode in the mousemove event
- 'allows freehand draw
- If Shift Then 'ctrl , alt or shift
- 'the following allows a straight line
- 'while the shift key is down
- If Abs(X - miStartX) > Abs(Y - miStartY) Then
- miMoveY = miStartY \ 150
- Else
- miMoveX = miStartX \ 150
- End If
- End If
- Plot 150 * miMoveX, 150 * miMoveY, c
- Case CIRCMODE, CIRCFILLMODE
- Dim radius%
- 'compute radius
- radius = Sqr(Abs(miStartX - X) ^ 2 + Abs(miStartY - Y) ^ 2)
- 'shCircle is a shape defined as a circle
- 'and allows user to preview the circle
- shCircle.Width = 2 * radius
- shCircle.Height = 2 * radius
- shCircle.Left = miStartX - radius
- shCircle.Top = miStartY - radius
- Case LINEMODE
- 'shLine allows preview of line
- shLine.X1 = miStartX
- shLine.Y1 = miStartY
- shLine.X2 = X
- shLine.Y2 = Y
- Case RECTMODE, RECTFILLMODE
- 'following two lines allow user to drag box
- 'in any direction
- shRect.Left = -miStartX * (X > miStartX) - _
- X * (X <= miStartX)
- shRect.Top = -miStartY * (Y > miStartY) - _
- Y * (Y <= miStartY)
- shRect.Width = Abs(miStartX - X)
- shRect.Height = Abs(miStartY - Y)
- Case TEXTMODE
- 'nothing to do
- Case CAPTUREMODE
- 'same coding as for rectangle
- 'just uses a rectangle shape with dashed border
- shCapture.Left = -miStartX * (X > miStartX) - _
- X * (X <= miStartX)
- shCapture.Top = -miStartY * (Y > miStartY) - _
- Y * (Y <= miStartY)
- shCapture.Width = Abs(miStartX - X)
- shCapture.Height = Abs(miStartY - Y)
- End Select
- End If 'if Button
- End Sub
- 'This is where the actual drawing occurs. When
- ' this is fired, miStartX/miStartY define where
- ' the mouse went down and X/Y define where
- ' it is now
- Private Sub grid_MouseUp(Button As Integer, _
- Shift As Integer, X As Single, Y As Single)
- Dim c&
- 'get color for subsequent ops
- If Button = 1 Then
- c = LeftColor.BackColor
- Else
- c = RightColor.BackColor
- End If
- Select Case miMode
- Case CIRCMODE, CIRCFILLMODE
- If miMode = CIRCMODE Then
- Ikon.FillStyle = 1 'unfilled
- Else
- Ikon.FillStyle = 0 'filled
- End If
- Ikon.FillColor = c
- 'radius is just shCircle's width or height / 2
- Ikon.Circle (miStartX \ 150, miStartY \ 150), shCircle.Width / 300, c
- Ikon2Grid
- 'setting the shapes & lines to minimum
- 'height/width precludes having them jump
- 'back to previous size when made visible again
- shCircle.Width = 0
- shCircle.Height = 0
- shCircle.Visible = False
- Case LINEMODE
- 'shLine is actually a line and not a shape
- ' its X1,Y1,X2,Y2 properties make it easy
- ' to define the line parameters
- Ikon.Line (shLine.X1 \ 150, shLine.Y1 \ 150)-(shLine.X2 \ 150, shLine.Y2 \ 150), c
- 'the line drawing routine does not set the
- ' final point, so the following is necessary
- Ikon.PSet (shLine.X2 \ 150, shLine.Y2 \ 150), c
- Ikon2Grid
- shLine.X1 = 0: shLine.Y1 = 0: shLine.X2 = 0: shLine.Y2 = 0
- shLine.Visible = False
- Case RECTMODE, RECTFILLMODE
- If miMode = RECTMODE Then
- 'for some reason, vbTransparent
- 'equates to zero, so...
- Ikon.FillStyle = 1
- Ikon.Line (miStartX \ 150, miStartY \ 150)-(X \ 150, Y \ 150), c, B
- Else
- Ikon.FillStyle = vbSolid
- Ikon.Line (miStartX \ 150, miStartY \ 150)-(X \ 150, Y \ 150), c, BF
- End If
- Ikon2Grid
- shRect.Width = 0: shRect.Height = 0
- shRect.Visible = False
- Case TEXTMODE
- 'try to center the letter on the mouseup coord
- Ikon.CurrentX = X \ 150 - (Ikon.TextWidth(txtAlpha)) / 2
- Ikon.CurrentY = Y \ 150 - (Ikon.TextHeight(txtAlpha)) / 2
- Ikon.ForeColor = c
- Ikon.Print txtAlpha
- Ikon2Grid
- Case FLOODMODE
- 'I've tried many times to write a flood fill
- ' routine with little success. The API call
- ' below does it well
- Dim Result&
- Ikon.FillStyle = vbSolid
- Ikon.FillColor = c
- Ikon.Picture = Ikon.Image
- Result = ExtFloodFill(Ikon.hdc, miStartX \ 150, _
- miStartY \ 150, _
- Ikon.Point(X \ 150, Y \ 150), _
- FLOODFILLSURFACE)
- Ikon2Grid
- Case CAPTUREMODE
- cmdCopy.Enabled = True
- cmdCut.Enabled = True
- Case PASTEMODE
- 'This could be simplified by having the
- 'cmdCut & cmdCopy routines define
- 'miCapWidth & miCapHeight
- Ikon.PaintPicture picCap.Image, X \ 150, Y \ 150, _
- miCapX2 - miCapX1 + 1, miCapY2 - miCapY1 + 1, _
- 0, 0, miCapX2 - miCapX1 + 1, miCapY2 - miCapY1 + 1
- Ikon2Grid
- shCapture.Width = 0: shCapture.Height = 0
- shCapture.Visible = False
- End Select
- End Sub
- Private Sub mnuFileExit_Click()
- 'Here, if desired, one could add some code
- 'to see if the user wants to save the drawing.
- Unload Me 'fini
- End Sub
- Private Sub mnuFileOpen_Click()
- cd.Filter = "Icon Files (*.ico)|*.ico"
- cd.ShowOpen
- If Err <> 32755 Then
- Caption = "Icon32 - " & cd.filename
- Ikon.Picture = LoadPicture(cd.filename)
- Ikon2Grid
- End If
- End Sub
- 'Workhorse routine: transfers ikon's picture
- ' to the grid
- Private Sub Ikon2Grid()
- Dim X%, Y%
- For Y = 0 To 31
- For X = 0 To 31
- Plot 150 * X, 150 * Y, Ikon.Point(X, Y)
- Next
- Next
- End Sub
- Private Sub mnuFileSave_Click()
- Dim nam$
- nam = cd.filename
- cd.Filter = "Icon Files (*.ico)|*.ico"
- cd.Flags = cdlOFNOverwritePrompt
- cd.ShowSave
- If Err <> 32755 Then 'i.e. if user didn't cancel
- If nam <> cd.filename Then
- Caption = "Icon32 - " & cd.filename
- End If
- Ikon.Picture = Ikon.Image
- SavePicture Ikon.Picture, cd.filename
- End If
- End Sub
- 'This one's fairly self-explanatory
- Private Sub cmdShift_Click(Index As Integer)
- Select Case Index
- Case 0
- ShiftRight
- Case 1
- ShiftLeft
- Case 2
- ShiftUp
- Case 3
- ShiftDown
- Case 4
- ShiftUp
- ShiftLeft
- Case 5
- ShiftUp
- ShiftRight
- Case 6
- ShiftDown
- ShiftLeft
- Case 7
- ShiftDown
- ShiftRight
- End Select
- Ikon2Grid
- End Sub
- 'This and the following 6 routines just
- 'took a little math trial & error
- Private Sub ShiftRight()
- Dim X%, Y%
- For Y = 0 To 31
- For X = 31 To 1 Step -1
- Ikon.PSet (X, Y), Ikon.Point(X - 1, Y)
- Next
- Ikon.PSet (0, Y), QBColor(15)
- Next
- End Sub
- Private Sub ShiftLeft()
- Dim X%, Y%
- For Y = 0 To 31
- For X = 0 To 30
- Ikon.PSet (X, Y), Ikon.Point(X + 1, Y)
- Next
- Ikon.PSet (31, Y), QBColor(15)
- Next
- End Sub
- Private Sub ShiftUp()
- Dim X%, Y%
- For X = 0 To 31
- For Y = 0 To 30
- Ikon.PSet (X, Y), Ikon.Point(X, Y + 1)
- Next
- Ikon.PSet (X, 31), QBColor(15)
- Next
- End Sub
- Private Sub ShiftDown()
- Dim X%, Y%
- For X = 0 To 31
- For Y = 31 To 1 Step -1
- Ikon.PSet (X, Y), Ikon.Point(X, Y - 1)
- Next
- Ikon.PSet (X, 0), QBColor(15)
- Next
- End Sub
- Private Sub cmdFlipH_Click()
- Dim X%, Y%, w&(0 To 31, 0 To 31)
- For Y = 0 To 31
- For X = 0 To 31
- w(X, Y) = Ikon.Point(X, Y)
- Next
- Next
- For Y = 0 To 31
- For X = 31 To 0 Step -1
- Ikon.PSet (X, Y), w(31 - X, Y)
- Next
- Next
- Ikon2Grid
- End Sub
- Private Sub cmdFlipV_Click()
- Dim X%, Y%, w&(0 To 31, 0 To 31)
- For Y = 0 To 31
- For X = 0 To 31
- w(X, Y) = Ikon.Point(X, Y)
- Next
- Next
- For Y = 31 To 0 Step -1
- For X = 0 To 31
- Ikon.PSet (X, Y), w(X, 31 - Y)
- Next
- Next
- Ikon2Grid
- End Sub
- Private Sub cmdRotate_Click()
- Dim X%, Y%, w&(0 To 31, 0 To 31)
- For Y = 0 To 31
- For X = 0 To 31
- w(X, Y) = Ikon.Point(X, Y)
- Next
- Next
- For Y = 0 To 31
- For X = 0 To 31
- Ikon.PSet (Y, X), w(X, Y)
- Next
- Next
- Ikon2Grid
- End Sub
- Private Sub cmdClear_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim c&
- If Button = 1 Then
- c = LeftColor.BackColor
- Else
- c = RightColor.BackColor
- End If
- Ikon.Line (0, 0)-(31, 31), c, BF
- Ikon2Grid
- End Sub
- Private Sub cmdCopy_Click()
- cmdPaste.Enabled = True
- cmdCopy.Enabled = False
- cmdCut.Enabled = False
- With shCapture
- .Visible = False
- miCapX1 = .Left \ 150
- miCapY1 = .Top \ 150
- miCapX2 = (.Left + .Width) \ 150
- miCapY2 = (.Top + .Height) \ 150
- End With
- picCap.Cls
- picCap.PaintPicture Ikon.Image, 0, 0, miCapX2 - miCapX1 + 1, miCapY2 - miCapY1 + 1, miCapX1, miCapY1, miCapX2 - miCapX1 + 1, miCapY2 - miCapY1 + 1
- End Sub
- Private Sub cmdCut_Click()
- cmdCopy_Click
- Ikon.Line (miCapX1, miCapY1)-(miCapX2, miCapY2), QBColor(15), BF
- Ikon2Grid
- End Sub
- Private Sub cmdPaste_Click()
- picMode.Picture = cmdPaste.Picture
- cmdCopy.Enabled = False
- cmdCut.Enabled = False
- miMode = PASTEMODE
- End Sub
- Private Sub cmdGrid_Click()
- If cmdGrid.Caption = "&Grid" Then
- cmdGrid.Caption = "&No Grid"
- Dim i%
- For i = 0 To 31 'draw the grid
- grid.Line (0, 150 * i)-(4799, 150 * i), 0
- grid.Line (150 * i, 0)-(150 * i, 4799), 0
- Next
- Else
- cmdGrid.Caption = "&Grid"
- grid.Cls 'clear out everything
- Ikon2Grid 'redraw the picture
- End If
- End Sub
- Private Sub cmdFont_Click()
- cd.Flags = cdlCFBoth Or cdlCFEffects
- 'show printer & screen fonts
- cd.FontName = "Ms Sans Serif"
- cd.ShowFont
- If Err <> 32755 Then
- cmdFont.Caption = cd.FontName
- txtAlpha.Font = cd.FontName
- txtAlpha.ForeColor = cd.Color
- txtAlpha.FontItalic = cd.FontItalic
- txtAlpha.FontBold = cd.FontBold
- 'could also change the textbox fontsize
- 'but would require manipulating its height
- Ikon.Font = cd.FontName
- Ikon.FontSize = cd.FontSize
- Ikon.FontItalic = cd.FontItalic
- Ikon.FontBold = cd.FontBold
- End If
- End Sub
- Private Sub picModeSel_Click(Index As Integer)
- 'handles a click on any of the modes
- miMode = Index
- picMode.Picture = picModeSel(Index).Picture
- SBar.Panels(1).Text = picModeSel(Index).ToolTipText
- UpdateSBar
- cmdPaste.Enabled = False
- cmdCut.Enabled = False
- cmdCopy.Enabled = False
- shCapture.Visible = False
- 'in case the user selected an area, then
- ' changed modes
- End Sub
- Private Sub txtAlpha_GotFocus()
- 'saves the user a mouseclick
- picModeSel_Click TEXTMODE
- End Sub
-